import { SOURCE_URL } from '@/constant/index.js'
const systemInfo = uni.getSystemInfoSync()
export default {
	methods: {
		openWxShare() {
			uni.showShareMenu({
				withShareTicket: true,
				menus: ['shareAppMessage', 'shareTimeline']
			})
		},
		toUrl(path, checkLogin = false) {
			if (!path) return
			if (checkLogin) {
				if (!this.$store.getters.hasLogin) {
					return this.$toast({ title: '您还没有登录' }, () => {
						uni.redirectTo({
							url: '/pages/public/login'
						})
					});
				}
			}
			uni.navigateTo({
				url: path,
			})
		},
	},
	computed: {
		sourceUrl() {
			return SOURCE_URL
		},
		sysInfoData() {
			return systemInfo
		},
		loadMoreIcon() {
			return 'semicircle'
		},
		statusBarHeight_() {
			return systemInfo.statusBarHeight + "px"
		},
	}
}